<template>
     <div>
        <t-map :show-area="false" :markersList="markersList" :height="'calc(100vh - 50px)'"></t-map>
     </div>
</template>
<script>
    import TMap from '@/views/components/TMap/TMap.vue'
    import { reserve } from '@/tempData/物资.js'
    export default {
        components:{TMap},
        data(){
            return{
                reserve
            }
        },
        computed: {
            markersList(){
                var list = [];
                this.reserve.map((item, index) => {
                    if (item['储备库名称'] == '区绿化管理所仓库') {
                        return;
                    }
                    const lngLat = [item['经度'], item['纬度']];
                    const htmlkeys = ['主管部门', '储备库名称', '联系电话'];
                    let html_info = '<br>';
                    let content = '';
                    for (let k of htmlkeys) {
                        content = content + '<div>' + k + ':' + item[k] + '</div>';
                    }
                    content = content + '<p style="text-align:center;font-size:16px;margin:5px 0;"><a  href="/home/support/shops/shop-detail?name='+item['储备库名称']+'">查看更多</a></p>';
                    list.push({content,lngLat})
                });
                return list;
            }
        },
    }
</script>